package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 子订单状态
 *
 * @author kellen
 * @date 2024/5/1
 */
@Getter
@AllArgsConstructor
public enum SubOrderStatusEnum implements BaseEnum<String> {

    ing("IG", "服务中"),
    success("SC", "服务成功"),
    fail("FL", "服务失败");

    private String code;
    private String desc;

    public static String getDesc(String code) {
        SubOrderStatusEnum[] businessModeEnums = values();
        for (SubOrderStatusEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return null;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
